package edu.sctu.zhangwang.month201505.day20150527.test01;

import java.util.Random;

/**
 * Created by Administrator on 2015/5/27 0027.
 */
public class DishCard {
    public double consume;//消费
    public double balance;//余额

    public DishCard(double balance){
        this.balance = balance;
    }
    public void setConsume(){
        Random rand = new Random();
        double consume0 = rand.nextInt(16)+5;
        consume = consume0;
        System.out.println("本次消费："+this.consume);
    }
    public double getConsume(){

        return consume;
    }
    public double getBalance(){
        balance -= consume;
        return balance;
    }
}
